package com.appinterfacelite.mapper;

import com.appinterfacelite.entity.Homepage_detailsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * homepage_details表的ORM映射
 */
@Mapper
public interface Homepage_detailsMapper extends BaseMapper<Homepage_detailsEntity> {
    @Select("select b.* " +
            "from home_user a left join homepage_details b on a.menu_id=b.homepage_id " +
            "where a.user_id= #{user_id} order by a.number")
    List<Homepage_detailsEntity> homepage_detail_select(String user_id);

    @Select("select distinct b.one_menu,b.two_menu,b.url,b.homepage_title,b.homepage_id " +
            "from home_role a, homepage_details b " +
            "where " +
            "a.menu_id=b.homepage_id and a.role_id= #{role_id}")
    List<Homepage_detailsEntity> menu_select(String role_id);

}
